package ar.com.cema.methodology.analyzer.services.beans.reports;

import ar.com.cema.methodology.analyzer.model.Methodology;

public class MethodologyScore implements Comparable<MethodologyScore> {
	private Methodology methodology;
	private Double score;

	public MethodologyScore() {
		super();
	}
	public MethodologyScore(Methodology methodology, Double score) {
		super();
		this.methodology = methodology;
		this.score = score;
	}
	public Methodology getMethodology() {
		return methodology;
	}
	public void setMethodology(Methodology methodology) {
		this.methodology = methodology;
	}
	public Double getScore() {
		return score;
	}
	public void setScore(Double score) {
		this.score = score;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((methodology == null) ? 0 : methodology.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof MethodologyScore)) {
			return false;
		}
		MethodologyScore other = (MethodologyScore) obj;
		if (methodology == null) {
			if (other.methodology != null) {
				return false;
			}
		} else if (!methodology.equals(other.methodology)) {
			return false;
		}
		return true;
	}
	@Override
	public int compareTo(MethodologyScore o) {
		return (this.getMethodology().getId().compareTo(o.getMethodology().getId()));
	}
	@Override
	public String toString() {
		return "MethodologyScore [methodology=" + methodology.getId() + ", score=" + this.getScore() + "]";
	}
}
